﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:cvt="clr-namespace:PoshConsole.Controls;assembly="
	x:Class="PoshConsole.Controls.ProgressPanel"
	x:Name="ProgressDisplayPanel"
   Width="Auto" MinWidth="250" Height="Auto" Margin="0,0,0,0"

   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
   mc:Ignorable="d"
   >


	<Grid x:Name="LayoutRoot" Margin="5,5,5,5">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
        <ProgressBar Value="{Binding Path=PercentComplete, ElementName=ProgressDisplayPanel, Mode=Default, FallbackValue=42}" Grid.Row="4" x:Name="progressBar" ToolTip="Percent Complete" HorizontalAlignment="Stretch" Width="Auto" Height="20" >
		<ProgressBar.Template>
		    <ControlTemplate TargetType="{x:Type ProgressBar}">
        <DockPanel Margin="0,0,2,2" x:Name="PART_Track" LastChildFill="False">
            <Rectangle x:Name="PART_Indicator">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF223B84" Offset="1"/>
                        <GradientStop Color="#FF57A0F4" Offset="0.5"/>
                        <GradientStop Color="#FF4B94EC" Offset="0.5"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
        </DockPanel>
    </ControlTemplate>
		</ProgressBar.Template>
            <ProgressBar.Foreground>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF223B84" Offset="1"/>
                                <GradientStop Color="#FF57A0F4" Offset="0.5"/>
                                <GradientStop Color="#FF4B94EC" Offset="0.5"/>
                            </LinearGradientBrush>
            </ProgressBar.Foreground>
        </ProgressBar>
        <Label SnapsToDevicePixels="False" x:Name="activity" ToolTip="Activity" Content="{Binding Path=Activity, ElementName=ProgressDisplayPanel, Mode=Default}" FontSize="16" FontWeight="Bold" Padding="0,0,0,5" HorizontalAlignment="Stretch" Width="Auto" Foreground="{Binding Path=Foreground, ElementName=ProgressDisplayPanel, Mode=Default}"/>
		<Label Content="{Binding Path=Status, ElementName=ProgressDisplayPanel, Mode=Default}" IsHitTestVisible="True" SnapsToDevicePixels="False" x:Name="status" ToolTip="Status Description" Padding="10,0,5,5" Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Foreground="{Binding Path=Foreground, ElementName=ProgressDisplayPanel, Mode=Default}"/>
		<Label Content="{Binding Path=TimeRemaining, ElementName=ProgressDisplayPanel, Mode=Default, StringFormat=\{0:dd.hh:mm:ss\} Remaining}" SnapsToDevicePixels="False" HorizontalAlignment="Stretch" x:Name="secondsRemaining" ToolTip="Time Remaining" VerticalAlignment="Bottom" Height="26.399" FontFamily="Segoe UI" FontSize="12" FontStretch="ExtraExpanded" FontWeight="Bold" HorizontalContentAlignment="Right" Padding="0,5,0,5" VerticalContentAlignment="Bottom" Grid.Row="3" Grid.RowSpan="1" Width="Auto" Foreground="{Binding Path=Foreground, ElementName=ProgressDisplayPanel, Mode=Default}"/>
		<Label SnapsToDevicePixels="False" x:Name="operation" ToolTip="Current Operation" Content="{Binding Path=Operation, ElementName=ProgressDisplayPanel, Mode=Default}" Padding="0,0,0,0" Grid.Row="3" d:LayoutOverrides="GridBox" HorizontalAlignment="Stretch" Width="Auto" Foreground="{Binding Path=Foreground, ElementName=ProgressDisplayPanel, Mode=Default}"/>
	</Grid>
</UserControl>